class StrUtil {
  static String insertCharAt(String oldString, int index, String newChar) {
    return oldString.substring(0, index) + newChar + oldString.substring(index);
  }

  static String capitalize(String s) => s[0].toUpperCase() + s.substring(1);

  static List<String> splitStringByIndex(String str, int index) =>
      [str.substring(0, index), str.substring(index + 1)];

  static String zeroPad(int number, int? size) {
    String s = number.toString();
    while (s.length < (size != null ? size : 2)) {
      s = "0" + s;
    }
    return s;
  }

  static bool hasValue(String? str) {
    if (str == null || str == '') return false;
    if (str.trim() == "") return false;
    return true;
  }

  static bool notHasValue(String? str) {
    return !hasValue(str);
  }
  
}
